package com.cicadamob.contact.api.service;

import android.os.Environment;

import com.cicadamob.contact.api.Utils.ContactConfig;
import com.cicadamob.contact.api.Utils.DateUtil;
import com.cicadamob.contact.api.Utils.Data.File.FileUtil;

/** 
* 
* @ClassName: WriteLog 
* @Description: TODO(日志输出) 
* @author hezuzhi 352306904@qq.com
* @date 2014-12-3 上午11:29:00 
* @version: 
*/
public class WriteLog {
	/**动态相关*/
	public static final String Task_Log_Path=Environment.getExternalStorageDirectory().getAbsolutePath()+"/ManagerAssistant/Task_Log";
	public static final String Task_Log_Name= "TaskLog_New_";
	public static final String Location_Log_Name= "Location_";
	
	public static final String Location_Time_Log_Path=Environment.getExternalStorageDirectory().getAbsolutePath()+"/ManagerAssistant/LocationTimeLog";
	public static final String Location_Time_Log_Name= "LocationDynamicListActivity";
	public static void WriteLog(final String log_temp,final String log){
//		writeLogUtil.WriteLog(HttpUtils.Task_Log,log_temp+": "+log);
		WriteLogIntentService.writeFileLog(ContactConfig.getContext(), Task_Log_Path, Task_Log_Name, log_temp+": "+log, true);

	}
	public static void WriteLocationLog(final String log_temp,final String log){
//		writeLogUtil.WriteLog(HttpUtils.Task_Log,log_temp+": "+log);
		WriteLogIntentService.writeFileLog(ContactConfig.getContext(), Task_Log_Path, Location_Log_Name, log_temp+": "+log, true);

	}
	public static void WriteLocationListLog(final String log_temp,final String log){
		WriteLogIntentService.writeFileLog(ContactConfig.getContext(), Task_Log_Path, Location_Log_Name, log_temp+": "+log, true);

	}
	public static void WriteLocationListTimeLog(final String log_temp,final String log){
		WriteLogIntentService.writeFileLog(ContactConfig.getContext(), Location_Time_Log_Path, Location_Time_Log_Name, log_temp+": "+log, true);

	}
	
	/**
	 * sdk保存日志
	 * @param log_temp
	 * @param log
	 */
	public static void WriteLocationListLogSDK( String log){
		WriteLogIntentService.writeFileLog(ContactConfig.getContext(), Task_Log_Path, "Contact_SDK_", DateUtil.getFormatDate("yyyy/MM/dd/HH:mm:ss毫秒:SSS")+": "+log, true);
	}
	/**
	 * 测试使用，不建议使用该方法到正式环境
	 */
	public static void WriteLocationListLogSDK(String model, String log){
		FileUtil.writeLogToFile(Task_Log_Path, "Contact_SDK_"+model, DateUtil.getFormatDate("yyyy/MM/dd/HH:mm:ss毫秒:SSS")+": "+log, true);
	}
}
